import router from "./";
import NProgress from "nprogress"
import "nprogress/nprogress.css"
import { useCommonStore } from "@/stores/common";
NProgress.configure({ showSpinner: false })
router.beforeEach((to, from) => {
    const commonStore = useCommonStore()
    if(to.meta.keepAlive && !commonStore.includeList.includes(to.name as never)){
      commonStore.includeList.push(to.name as never)
    }
    NProgress.start()
  
  });


  router.afterEach((to) => {
    document.title = to.meta.name as string;
    NProgress.done()
  })